package com.hollysys.hollimsa.biz.istio.destinationrule.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 *
 * @author wangyuxi
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class DestinationRuleDetailDTO implements Serializable {

    private static final long serialVersionUID = -338332819148487067L;
    @ApiModelProperty("组件名称")
    private String name;

    @ApiModelProperty("组件创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdAt;

    @ApiModelProperty(value = "关联底层服务|服务注册表中的服务名称")
    private String host;

    @ApiModelProperty(value = "版本划分")
    private Subset[] subsets;


    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    public static  class Subset implements  Serializable {

        private static final long serialVersionUID = 2251030115627513288L;

        @ApiModelProperty(value = "子集的名称。服务名称和子集名称可用于路由规则中的流量拆分。")
        private String name;
        @ApiModelProperty(value = "标签在服务注册表中的服务端点上应用过滤器。")
        private String labels;
    }
}

